﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

/**
 * 创建时间：2015/1/9 17:48:16
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */

namespace ComicIsland.Common.Converter
{
    public sealed class TextLengthConverter : IValueConverter
    {
        private int MAX_LENGTH = 140;
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int num = (int)value;
            return this.MAX_LENGTH - num;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
